package com.blackitheima1.LambdaDemo.test3;
//Lambda表达式 有参无返回值
public class TestFly {
    public static void main(String[] args) {
        //匿名内部类
        goFly(new ToFly() {
            @Override
            public void fly(String s) {
                System.out.println("天使的翅膀");
                System.out.println(s);
            }
        });
        //Lambda表达式
        goFly((s)-> System.out.println("地上行走的翅膀"));
        //创建实现类对象
        ToFlyImple ti=new ToFlyImple();
        ti.fly("黑色的翅膀");
    }
    public static void goFly(ToFly toFly){
        toFly.fly("隐形的翅膀");
    }
}

//接口
interface ToFly{
    public abstract void fly(String s);
}
//实现类
class ToFlyImple implements ToFly{

    @Override
    public void fly(String s) {
        System.out.println(s);
    }
}
